<template>
  <div>
    <h1>圈内热点的详情页</h1>
    <p>{{ item.content }}</p>
    <p>{{ info }}</p>
    <button @click="manyGo">manyGo</button>
  </div>
</template>

<script>
import redaData from "../../data/data.js";
export default {
  name: "",
  props: ["info"],
  data() {
    return {
      redaData,
      item: {},
    };
  },

  components: {},

  computed: {},

  beforeMount() {},

  mounted() {
    console.log(this.redaData);
    // params数据的读取方式
    // console.log(this.$route.params.index);
    // 有下表 有数组 获取对应下标的数组中的item  detail
    /* let result = this.redaData[this.$route.params.index];
    console.log(result);
    this.item = result.detail;
    console.log(this.item); */
    // query的值的读取方式
    console.log(this.$route.query.index);
    let result = this.redaData.find((item, index) => {
      return index == this.$route.query.index;
    });
    this.item = result.detail;
    console.log(result);
  },

  methods: {
    manyGo() {
      this.$router.go(-2);
    },
  },

  watch: {},
};
</script>
<style lang='' scoped>
</style>